import requests
import json
if __name__== "__main__":
    url='https://www.bilibili.com/'

    headers={
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'  
    }

    response=requests.get(url=url,headers=headers)
    with open ('.\链接爬取\\bilibili.html','w',encoding='utf-8') as fp:
        fp.write(response.text)
    print('ok')